<template>
	<view class="container">
		<u-navbar :title-bold='true' title='身份认证' :border-bottom='false'></u-navbar>

		<image :src="src" mode=""></image>
		<p class="p1">{{msg}}</p>
		<p class="p2">{{dsc}}</p>

		<view @click="reUpload" v-if="audit" class="btn">重新上传</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				msg: '',
				dsc: '',
				src: '',
				audit: 0,
			}
		},
		onLoad() {
			//0=待审核,1=审核成功,2=审核失败
			this.getAudit()
		},
		methods: {
			reUpload() {
				uni.redirectTo({
					url: 'realname'
				})
			},
			getAudit() {
				let that = this
				let user = that.ws.getUserInfo()
				that.audit = user.audit
				if (that.audit == 1 || that.audit > 2) {
					// uni.switchTab({
					// 	url: '/pages/message/message'
					// })
				}
				if (that.audit == 2) {
					that.msg = '资料审核失败！'
					that.dsc = '请按照规定上传身份证照片，未能清晰查看您的身份证信息！'
					that.src = '../../static/img/729.png'
				}

				if (that.audit == 0) {
					that.msg = '资料审核中！'
					that.dsc = '平台将于3个工作日内完成资料审核，并将审核结果以站内消息的形式通知您 ！'
					that.src = '../../static/img/726.png'
				}
			},

		}
	}
</script>

<style lang="less">
	.container {
		height: 100vh;
		display: flex;
		flex-flow: column;
		text-align: center;
		align-items: center;
		background-color: rgba(255, 255, 255, 0.6);

		image {
			height: 160px;
			width: 237px;
			margin-top: 20%;
		}

		p {
			width: 70vw;
			opacity: 0.8;
		}

		.p1 {
			font-weight: bold;
			margin-top: 20px;
		}

		.p2 {
			font-size: small;
			opacity: 0.5;
			margin-top: 30px;
		}

		.btn {
			width: 141px;
			line-height: 42px;
			text-align: center;
			border-radius: 30px;
			color: #FFF;
			margin: 0 auto;
			margin-top: 40px;
			background-color: #6EC9E1;
		}

		.info {
			width: 70vw;
			height: 82px;
			display: flex;
			flex-flow: column;
			justify-content: center;
			border-radius: 20px;
			margin: 0 auto;
			margin-top: 30px;
			background-color: #FFF;
		}
	}
</style>